import request from '@/utils/request'

// 获取企业客户列表
export function getCustomerList(data) {
  return request({
    url: '/customer/bizcustomer/list',
    method: 'post',
    data
  })
}
// 根据名称获取企业客户列表
export function getListByCustomerName(data) {
  return request({
    url: '/customer/bizcustomer/listByCustomerName',
    method: 'post',
    params: data
  })
}
// 获取企业客户列表
export function getListByCustomer(data) {
  return request({
    url: '/customer/bizcustomer/listByCustomer',
    method: 'post',
    data
  })
}

// 创建企业客户
export function createCustomer(data) {
  return request({
    url: '/customer/bizcustomer/save',
    method: 'post',
    data
  })
}
// 更新信息客户---回访功能用
export function visitUpdateCustomer(data) {
  return request({
    url: '/customer/bizcustomer/updateCustomer',
    method: 'post',
    data
  })
}

// 供应商评价列表
export function getDmGyHyByName(query) {
  return request({
    url: '/customer/bizcustomer/getDmGyHyByName',
    method: 'get',
    params: query
  })
}

//修改企业客户
export function updateCustomer(data) {
  return request({
    url: '/customer/bizcustomer/update',
    method: 'post',
    data
  })
}

//删除企业客户
export function delCustomer(params) {
  return request({
    url: '/customer/bizcustomer/delete',
    method: 'delete',
    params
  })
}

//获取客户详情
export function getCustomerInfo(id) {
  return request({
    url: `/customer/bizcustomer/info/${id}`,
    method: 'get'
  })
}

//获取需要修改的客户详情
export function getCustomerEditInfo(id) {
  return request({
    url: `/customer/bizcustomer/editinfo/${id}`,
    method: 'get'
  })
}

/**
 * 获取客户详情联系人列表
 */
export function getDetailTactlist(data) {
  return request({
    url: '/customer/bizcustomer/detailTactlist',
    method: 'post',
    data
  })
}
/**
 * 获取客户下级客户列表
 */
export function getDetailRefUserlist(data) {
  return request({
    url: '/customer/bizcustomer/detailRefUserlist',
    method: 'post',
    data
  })
}

/**
 * 移入公海
 */
export function updateForOpenSea(data) {
  return request({
    url: '/customer/bizcustomer/updateForOpenSea',
    method: 'post',
    data: data
  })
}

/**
 * 切换首要联系人
 */
export function updateForMainContact(data) {
  return request({
    url: '/customer/bizcustomer/updateForMainContact',
    method: 'post',
    params: data
  })
}

/**
 * 重点关注新增编辑
 * @param data
 * @returns {*}
 */
export function addFocus(data) {
  return request({
    url: '/customer/bizfocuslist/addFocus',
    method: 'post',
    data: data
  })
}
/**
 * 重点关注查询
 * @param data
 * @returns {*}
 */
export function getFocusInfo(data) {
  return request({
    url: '/customer/bizfocuslist/getFocusInfo',
    method: 'post',
    data: data
  })
}
/**通过客户名称id 搜索联系人下拉列表
 *
 * @param {*} data
 * @returns
 */
export function getDetailTactlistByCactName(data) {
  return request({
    url: '/customer/bizcustomer/detailTactlistByCactName',
    method: 'post',
    params: data
  })
}

/**通过客户名称id 搜索联系人下拉列表
 *
 * @param {*} data
 * @returns
 */
export function getDetailTactPage(data) {
  return request({
    url: '/customer/bizcustomer/detailTactPage ',
    method: 'post',
    data
  })
}

/**
 * 数电配置批量更新导入
 * @param {*} data
 * @returns
 */
export function importCustomerSsDigital(data) {
  return request({
    url: '/customer/bizcustomer/importUpdateData',
    method: 'post',
    data
  })
}
/**
 * 校验税号
 * @param {*} data
 * @returns
 */
export function checkCustomerTaxCode(taxCode) {
  return request({
    url: '/customer/bizcustomer/checkTaxCode?taxCode=' + taxCode,
    method: 'post'
  })
}
